	$(function() {
				//给通讯录里边的姓名排序
				//用for in  来循环遍历姓名里边的首字母
				var tongxun = tongxunlus.tongxunlu;
				for(var t in tongxun) {
					tongxun[t].pinyin = pinyinUtil.getFirstLetter(tongxun[t].xingming);
				}
				//排序
				for(var i = 0; i < tongxun.length - 1; i++) {
					for(var g = 0; g < tongxun.length - 1 - i; g++) {
						n = tongxun[g];
						if(tongxun[g].pinyin > tongxun[g + 1].pinyin) {
							tongxun[g] = tongxun[g + 1];
							tongxun[g + 1] = n;
						}
					}
				}
				//汉字转拼音
				var shouzimu = new Array();
				for(var j in tongxun) {
					shouzimu += tongxun[j].pinyin[0];
				}
				//排完序后添加到对应的div里边
				var szu = new Array();
				for(var sz = 0; sz < shouzimu.length; sz++) {
					if(szu.indexOf(shouzimu[sz]) > 0) {
						var a1 = $("<div class='a1'> </div>");
						var b1 = $("<div class='b1'> </div>");
						var img = $("<img/>");
						img[0].src = tongxun[sz].touxiang;
						var c1 = $("<span class='c1'> </span>");
						c1.html(tongxun[sz].xingming);
						b1.append(img);
						a1.append(b1);
						a1.append(c1);
						$(".xia").append(a1);
					} else {
						szu += shouzimu[sz];
						$(".xia").append('<div class="xia_title">' + shouzimu[sz] + '</div>');
						var a1 = $("<div class='a1'> </div>");
						var b1 = $("<div class='b1'> </div>");
						var img11 = $("<img/>");
						img11[0].src = tongxun[sz].touxiang;
						var c1 = $("<span class='c1'> </span>");
						c1.html(tongxun[sz].xingming);
						b1.append(img11);
						a1.append(b1);
						a1.append(c1);
						$(".xia").append(a1);
					}
				}
				//设置滚动条(有bug)
				$("#zijizuode").mouseover(function() {
					$("#gundongtiao").show();
				}).mouseout(function() {
					$("#gundongtiao").hide();
				});
				var huakuaitop = 0;
				var anxia = false;
				var gundongtiaotop = 0;
				var divtop = 0;
				//给滑块的按下事件时触发函数
				$(".huakuai").mousedown(function() {
					//兼容性问题
					var theEvent = window.event || arguments.callee.caller.arguments[0];
					//滑块移动的高度就是滑块的top
					huakuaitop = parseInt($(this).css("top"));
					anxia = true;
					//得到滑块到body的高度
					gundongtiaotop = theEvent.clientY;
					divtop = parseInt($(".xia").css("margin-top"));
					divtop = parseInt($(".xia1").css("margin-top"));
					divtop = parseInt($(".sc").css("margin-top"));
				});
				//鼠标松开事件
				$("#zijizuode").mouseup(function() {
					anxia = false;
				}).mousemove(function() {
					//兼容性问题
					var theEvent = window.event || arguments.callee.caller.arguments[0];
					var $huakuai = $(this).find(".huakuai");
					var movegaodu = theEvent.clientY - gundongtiaotop;
					var t = huakuaitop + movegaodu;
					if(anxia && t >= 0 && t <= 380) {
						$huakuai.css("top", t + "px");
						var moveheight = parseInt($(".xia").css("height"))-100;
						var moveheight = parseInt($(".xia1").css("height"))-100;
						var moveheight = parseInt($(".sc").css("height"))-100;
						var mtop = parseInt(movegaodu / 380 * moveheight);
						var vtop = divtop - mtop;
						if(t == 0) {
							vtop = 0;
						} else if(t == 380) {
							vtop = moveheight * -1;
						}
						$(".xia").css("margin-top", vtop + "px");
                        $(".xia1").css("margin-top", vtop + "px");
                        $(".sc").css("margin-top", vtop + "px");
					}
				});
				
				//右侧的聊天消息的设置点击发送消息
				$(".fasong").click(function() {
					//设置时间
					var d = new Date();
					var h = d.getHours();
					var f = d.getMinutes();
					var shijian = h + ":" + f;
					console.log(shijian);
					//设置自己和别的聊天内容，，通过创建新的div来设置
					var $liaotiandiv = $(".liaotiandiv");
					var $youzhong2 = $(".youzhong2");
					var $liaotian = $(".liaotiandiv");
//					var rand = parseInt(Math.random() * 2);
					//这句是为了不让每次发送的消息覆盖了之前的消息，但是失败了
					var xianshi = $liaotian.html();
//					xianshi += $liaotian.html();
					//实验创建div并给样式  聊天内容
					//              	if (rand==0) {
					//            		   $youzhong2.append("<div class='youfu'><div class='time'><div class='shijian1'></div></div><div class='zijitouxiang'><img src='img/3.jpg'/></div><div class='xiaosanjiaoyou'></div><div class='liaotianneirongyou'>君欲踏马归来滴答滴答滴答滴答滴答</div></div>");
					//                     $(".shijian1").html(shijian);
					//              	} else{
					//              		 $youzhong2.append("<div class='zuofu'><div class='time'><div class='shijian1'></div></div><div class='bierentouxiang'><img src='img/2.jpg'/></div><div class='liaotianneirongzuo'><div class='xiaosanjiaozuo'></div>君欲踏马归来</div></div>");
					//                     $(".shijian1").html(shijian);
					//              	}
					//输入的不能为空的聊天内容
					if($liaotiandiv.html().trim() == "") {
						//              		alert(2);
						$(".buneng").show();
					} else {
						//              		alert(1);
						$(".buneng").hide();
						//链接图灵机器人
						$youzhong2.append("<div class='youfu'><div class='time'><div class='shijian1'>"+shijian+"</div></div><div class='zijitouxiang'><img src='img/3.jpg'/></div><div class='xiaosanjiaoyou'></div><div class='liaotianneirongyou'>"+xianshi+"</div></div>");
						//请求图灵机器人api
						$.post("http://www.tuling123.com/openapi/api",{
							//需要图灵机器人的apikey
							key:"a1b2384e3e9f464f8798e93903f26d36",
							//得到客户端输入的信息进行交互
							info:$liaotian.html(),
							userid:"123456"
							},function  (data) {
								console.log(data.text);
							$youzhong2.append("<div class='zuofu'><div class='time'><div class='shijian1'>"+shijian+"</div></div><div class='bierentouxiang'>"+($(".dier").html())+"</div><div class='xiaosanjiaozuo'></div><div class='liaotianneirongzuo'>"+data.text+"</div></div>");
					        $(".youzhong2")[0].scrollTop = $(".youzhong2")[0].scrollHeight;
								
							});   
							$liaotiandiv.html("");
							$(".youzhong2")[0].scrollTop = $(".youzhong2")[0].scrollHeight;
					$("#zanshi").hide();
						};
//						if(rand == 0) {
//							$youzhong2.append("<div class='youfu'><div class='time'><div class='shijian1'>"+shijian+"</div></div><div class='zijitouxiang'><img src='img/3.jpg'/></div><div class='xiaosanjiaoyou'></div><div class='liaotianneirongyou'>"+xianshi+"</div></div>");
////							$(".shijian1").html(shijian);
////							$(".liaotianneirongyou").html(xianshi);
//						} else {
//							$youzhong2.append("<div class='zuofu'><div class='time'><div class='shijian1'>"+shijian+"</div></div><div class='bierentouxiang'>"+($(".dier").html())+"</div><div class='xiaosanjiaozuo'></div><div class='liaotianneirongzuo'>"+xianshi+"</div></div>");
////							$(".shijian1").html(shijian);
////							$(".bierentouxiang").html($(".dier").html());
////							$(".liaotianneirongzuo").html(xianshi);
//						};
//						$liaotiandiv.html("");
//					};
					//需要转换成dom才可以
//					$(".youzhong2")[0].scrollTop = $(".youzhong2")[0].scrollHeight;
//					$("#zanshi").hide();
		});
				//按下enter键发送
				$(".liaotiandiv").keydown(function  () {
					if (event.keyCode==13) {
						$(".fasong").click();
					}
				})
				  
				
				//添加表情
				$(".h1").click(function() {
					$(".h1").css("background-color", "#F2F2F2");
					$(this).css("background-color", "white");
				});
				$("#tu").click(function() {
					$("#biaoqing").hide();
					$("#tusiji").show();
					$("#jszuode").hide();
				});
				$("#weixinbiaoqing").click(function() {
					$("#biaoqing").show();
					$("#tusiji").hide();
					$("#jszuode").hide();
				});
				$("#tusi").click(function() {
					$("#jszuode").show();
					$("#biaoqing").hide();
					$("#tusiji").hide();
				});

				//用js的方法做的动态图
				//				var id = 0;
				//				var tupian = document.getElementById("tupian");
				//				tupian.onmouseover = function  () {
				//					var index = 0;
				//					id = setInterval(function  () {
				//						index++;
				//						tupian.src = "tusijitusiji/IMG000"+(index < 10 ? '0' + index : index)+".bmp";
				//					if (index>=15) {
				//						index=0;
				//					}
				//					},50)
				//				};
				//jq做的动态图
				var id = 0;
				$("#tupian").mouseover(function() {
					var index = 0;
					id = setInterval(function() {
						index++;
						$("#tupian").attr("src", "tusijitusiji/IMG000" + (index < 10 ? '0' + index : index) + ".bmp");
						if(index >= 15) {
							index = 0;
						}
					}, 50);

				});
				$("#tupian").mouseout(function() {
					clearInterval(id);
				});
				//兔斯基15的分离图片
				var id = 0;
				$("#tupian1").mouseover(function() {
					var index = 0;
					id = setInterval(function() {
						index++;
						$("#tupian1").attr("src", "tusiji15/IMG000" + (index < 10 ? '0' + index : index) + ".bmp");
						if(index >= 22) {
							index = 0;
						}
					}, 50);

				});
				$("#tupian1").mouseout(function() {
					clearInterval(id);
				});
				//兔斯基01的分离图片
				var id = 0;
				$("#tupian2").mouseover(function() {
					var index = 0;
					id = setInterval(function() {
						index++;
						$("#tupian2").attr("src", "tusiji01/IMG000" + (index < 10 ? '0' + index : index) + ".bmp");
						if(index >= 13) {
							index = 0;
						}
					}, 50);

				});
				$("#tupian2").mouseout(function() {
					clearInterval(id);
				});
				//兔斯基02的分离图片
				var id = 0;
				$("#tupian3").mouseover(function() {
					var index = 0;
					id = setInterval(function() {
						index++;
						$("#tupian3").attr("src", "tusiji02/IMG000" + (index < 10 ? '0' + index : index) + ".bmp");
						if(index >= 52) {
							index = 0;
						}
					}, 50);

				});
				$("#tupian3").mouseout(function() {
					clearInterval(id);
				});
				//兔斯基03的分离图片
				var id = 0;
				$("#tupian4").mouseover(function() {
					var index = 0;
					id = setInterval(function() {
						index++;
						$("#tupian4").attr("src", "tusiji03/IMG000" + (index < 10 ? '0' + index : index) + ".bmp");
						if(index >= 22) {
							index = 0;
						}
					}, 50);

				});
				$("#tupian4").mouseout(function() {
					clearInterval(id);
				});
				//兔斯基04的分离图片
				var id = 0;
				$("#tupian5").mouseover(function() {
					var index = 0;
					id = setInterval(function() {
						index++;
						$("#tupian5").attr("src", "tusiji04/IMG000" + (index < 10 ? '0' + index : index) + ".bmp");
						if(index >= 12) {
							index = 0;
						}
					}, 50);

				});
				$("#tupian5").mouseout(function() {
					clearInterval(id);
				});
				//兔斯基05的分离图片
				var id = 0;
				$("#tupian6").mouseover(function() {
					var index = 0;
					id = setInterval(function() {
						index++;
						$("#tupian6").attr("src", "tusiji05/IMG000" + (index < 10 ? '0' + index : index) + ".bmp");
						if(index >= 60) {
							index = 0;
						}
					}, 50);

				});
				$("#tupian6").mouseout(function() {
					clearInterval(id);
				});
				//退出那栏的显示
				$(".xiala").click(function() {
					$(".tuichu").toggle();
				});
				$(".z1").click(function() {
						$(".tuichu").hide();
					})
					//发起聊天
				$("#k11").click(function() {
					$(".tuichu").hide();
                    $(".faqiliaotian").show();
				});
				//关闭发起聊天
				$(".oo2").click(function  () {
					 $(".faqiliaotian").hide();
				});
				//关闭桌面通知
				$("#k12").click(function() {
					$(".tuichu").hide();
					if($("#k112").children(0).attr("src") == "img/桌面通知开.png") {
						$("#k112").get(0).children[0].src = "img/桌面通知关.png";
						$("#o2").html("打开桌面通知");
						$(this).attr("title", "打开桌面通知");
					} else {
						$("#k112").get(0).children[0].src = "img/桌面通知开.png";
						$("#o2").html("关闭桌面通知");
					}
				});
				//关闭声音
				$("#k13").click(function() {
					$(".tuichu").hide();
					if($("#k113").children(0).attr("src") == "img/声音开.png") {
						$("#k113").get(0).children[0].src = "img/声音关.png";
						$("#o3").html("打开声音");
						$(this).attr("title", "打开声音");
					} else {
						$("#k113").get(0).children[0].src = "img/声音开.png";
						$("#o3").html("关闭声音");
					}
				});
				//意见反馈
				$("#k14").click(function() {
					$(".tuichu").hide();
					$(".yijian").show();
				});
				$("#cuohao").click(function() {
					$(".yijian").hide();
				});
				//退出
				$("#k15").click(function() {
					if(confirm("确定要退出微信吗？")) {
						window.close();
					}
				});
				//基本信息的隐藏与显示
				$(".touxiang").click(function() {
					$(".jibenxinxi").toggle();
				});

				//放大效果
				$("#anniu").click(function() {
					var h = document.documentElement.clientHeight;
					$("#zuiwaice").css("width", "100%").css("height", h);
					$(".youce").css("width", "78.5%");
					$(".youce1").css("width", "78.5%");
					$(".youceliaotiankuang").css("width", "78.5%");
				});
				//缩小效果
				$("#suoxiao").click(function() {
					$("#zuiwaice").css("width", "1000px").css("height", "640px");
					$(".youce").css("width", "71%");
					$(".youce1").css("width", "71%");
					$(".youceliaotiankuang").css("width", "71%");
				});
				//通过创建div的方法将json中的数据调出来
				for(var k = 0; k < tongxunlus.tongxunlu.length; k++) {
					var fangliaotiande = $("<div class='aa1'></div>");
					var tx1 = $("<div class='bb1'></div>");
					var imgs1 = $("<img/>");
					imgs1[0].src = tongxunlus.tongxunlu[k].touxiang;
					var mingzi1 = $("<p class='cc1'></p>");
					mingzi1.html(tongxunlus.tongxunlu[k].xingming);
					var shijian = $("<span class='shijian'></span>");
					//得到系统时间并且给了json数组里边的空时间字符串。
					var time = new Date();
					var shi = time.getHours();
					var fen = time.getMinutes();
					var time22 = shi + ":" + fen;
					tongxunlus.tongxunlu[k].shijian = time22;
					shijian.html(tongxunlus.tongxunlu[k].shijian);
					var liaotian = $("<p class='liaotian'></p>");
					liaotian.html(tongxunlus.tongxunlu[k].liaotian);
					tx1.append(imgs1);
					fangliaotiande.append(mingzi1);
					fangliaotiande.append(shijian);
					fangliaotiande.append(tx1);
					fangliaotiande.append(liaotian);

					$(".xia1").append(fangliaotiande);
				};
				//左侧导航栏三个图片的切换以及对应的div层的切换
				$("#a1").click(function() {
					$(this).get(0).children[0].src = "img/QQ截图20170106005048.png";
					$("#a3").get(0).children[0].src = "img/QQ截图20170106005359.png";
					$("#a2").get(0).children[0].src = "img/QQ图片20170106005305.png";
					$(".xia1").css("display", "block");
					$(".xia").css("display", "none");
					$(".sc").css("display", "none");
				});
				$("#a3").click(function() {
					$(this).get(0).children[0].src = "img/QQ截图20170106005330.png";
					$("#a1").get(0).children[0].src = "img/QQ图片20170106005135.png";
					$("#a2").get(0).children[0].src = "img/QQ图片20170106005305.png";
					//未排序的通讯录的那栏
					//					for(var i = 0; i < tongxunlus.tongxunlu.length; i++) {
					//						//这个是创建放通讯录里的一个头像和一个姓名的div
					//						var fangtongxunlude = $("<div class='a1'></div>");
					//						var tx = $("<div class='b1'></div>");
					//						var imgs = $("<img/> ");
					//						imgs[0].src = tongxunlus.tongxunlu[i].touxiang;
					//						var mingzi = $("<span class='c1'></span>");
					//						mingzi.html(tongxunlus.tongxunlu[i].xingming);
					//						tx.append(imgs);
					//						fangtongxunlude.append(tx);
					//						fangtongxunlude.append(mingzi);
					//						$(".xia").append(fangtongxunlude);
					//					}
					$(".xia").css("display", "block");
					$(".xia1").css("display", "none");
					$(".sc").css("display", "none");
					$(".shoucangzuida").hide();
					console.log(tongxunlus.tongxunlu.length);
					console.log(tongxunlus.tongxunlu[0].touxiang);
					//里边各个聊天界面的层的切换
					$(".youce2").show();
					$(".youce").hide();
					$(".youce1").hide();
					$(".youceliaotiankuang").hide();
					//给每一个好友点击事件是把昵称和头像放到对应的框里边
					$(".a1").click(function() {
						$(".a1").css("background-color", "#2E3238");
						$(this).css("background-color", "#3A3F45");
						$(".youce1").show();
						$(".youce2").hide();
						$(".youceliaotiankuang").hide();
						$(".shoucangzuida").hide();
						console.log($(this).get(0).children[0].innerHTML);
						console.log($(this).get(0).children[1].innerHTML);
						//		$(this).get(0).children[0].innerHTML = $(".tou1").html();
						$(".tou1").html($(this).get(0).children[0].innerHTML);
						$(".tou2").html($(this).get(0).children[1].innerHTML);
						$("#beizhu").html($(this).get(0).children[1].innerHTML);
						$(".dier").html($(this).get(0).children[0].innerHTML);
						$(".s1").html($(this).get(0).children[1].innerHTML);
						$(".bierentouxiang").html($(this).get(0).children[0].innerHTML);
						$(".youzhong2").html("");
					});
					$(".tou5").click(function() {
						$(".youce1").hide();
						$(".youceliaotiankuang").show();
						$(".xia").hide();
						$(".xia1").show();
					})

				});
				//给每一个div点击事件并且改变颜色，把对应的头像放到对应的div里边
				$(".aa1").click(function() {
					$(".aa1").css("background-color", "#2E3238");
					$(this).css("background-color", "#3A3F45");
					$(".youceliaotiankuang").show();
					$(".youce").hide();
					$(".youce1").hide();
					$(".youce2").hide();
					$(".shoucangzuida").hide();
					console.log($(this).get(0).children[0].innerHTML);
					$(".s1").html($(this).get(0).children[0].innerHTML);
					console.log($(this).get(0).children[2].innerHTML);
					$(".dier").html($(this).get(0).children[2].innerHTML);
					$(".bierentouxiang").html($(this).get(0).children[2].innerHTML);
					console.log($(this).get(0).children[2].innerHTML);
					$(".youzhong2").html("");
				})
				$("#a2").click(function() {
					$(this).get(0).children[0].src = "img/QQ图片20170106005234.png";
					$("#a1").get(0).children[0].src = "img/QQ图片20170106005135.png";
					$("#a3").get(0).children[0].src = "img/QQ截图20170106005359.png";
					$(".xia1").css("display", "none");
					$(".xia").css("display", "none");
					$(".sc").css("display", "block");

					//点击阅读按钮时调用json写的收藏的导航栏
					for(var p = 0; p < shoucangs.shoucang.length; p++) {
						console.log(shoucangs.shoucang.length)
						var shoucangneirong = $("<div class='ming'></div>");
						var toubu = $("<div class='ff1'></div>");
						var toubu1 = $("<div class='fff1'></div>");
						toubu1.html(shoucangs.shoucang[p].toubu);
						var toubu2 = $("<div class='fff2'></div>");
						var time11 = new Date();
						var shi1 = time11.getHours();
						var fen1 = time11.getMinutes();
						var shijian11 = shi1 + ":" + fen1;
						shoucangs.shoucang[p].shijian = shijian11;
						toubu2.html(shoucangs.shoucang[p].shijian);
						var sscc = $("<div class='sscc'></div>");
						var xiezi = $("<div class='xiezi'></div>");
						xiezi.html(shoucangs.shoucang[p].shenti);
						var zhao = $("<div class='zhao'></div>");
						var imgss = $("<img/>");
						imgss[0].src = shoucangs.shoucang[p].zhaopian;
						zhao.append(imgss);
						toubu.append(toubu1);
						toubu.append(toubu2);
						sscc.append(xiezi);
						sscc.append(zhao);
						shoucangneirong.append(toubu);
						shoucangneirong.append(sscc);
						$(".sc").append(shoucangneirong);
					};

					//点击收藏时的事件
					$(".ming").click(function() {
						$(".sscc").css("background-color", "#2E3238");
						$(this).get(0).children[1].style.backgroundColor = "#3A3F45";
						$(".shoucangshang").html($(this).get(0).children[0].children[0].innerHTML)
						console.log($(this).get(0).children[0].children[0].innerHTML);
						$(".youceliaotiankuang").hide();
						$(".youce").hide();
						$(".youce1").hide();
						$(".youce2").hide();
						$(".shoucangzuida").show();
					})
				});

				//上下箭头的切换
				$("#huantu").click(function() {
					//用三元运算符写的
					//$(this).attr("src",$(this).attr("src")=="img/QQ图片20170106014241.png"?"img/上的箭头.png":"img/QQ图片20170106014241.png")
					//if判断方法
					if($(this).attr("src") == "img/QQ图片20170106014241.png") {
						$(this).attr("src", "img/上的箭头.png");
						//向下增大
						$(".xianshi").slideDown();
					} else {
						$(this).attr("src", "img/QQ图片20170106014241.png");
						//向上收缩
						$(".xianshi").slideUp();
					}
				});

				//表情的隐藏与显示
				$("#haolei").click(function() {
					$("#biao").slideToggle();
					//					$("#biao").toggle();
				});
				//gif动态图的发送
				$(".j1").click(function() {
					var kk = $(".liaotiandiv").html();
					var kkk = $(this).html();
					$(".liaotiandiv").html(kk + kkk);
					$("#biao").hide();
					console.log($(this).html());
				});
				//js做的表情的发送
				$(".tu1").click(function() {
					var ff = $(".liaotiandiv").html();
					var fff = $(this).html();
					$(".liaotiandiv").html(ff + fff);
					$("#biao").hide();
					console.log($(this).html());
				});
				//发起群聊的设置   调用json写的
				for(var n = 0; n < faqiliaotians.faqiliaotian.length; n++) {
					console.log(faqiliaotians.faqiliaotian.length)
					var qunliao = $("<div class='qunliao'></div>");
					var qunliaoface = $("<span class='qunliaoface'></span>");
					var face1 = $("<img/>");
					face1[0].src = faqiliaotians.faqiliaotian[n].touxiang;
					console.log(faqiliaotians.faqiliaotian[n].touxiang)
					var qunliaoming = $("<span class='qunliaoming'></span>");
					qunliaoming.html(faqiliaotians.faqiliaotian[n].nicheng);
					qunliaoface.append(face1);
					qunliao.append(qunliaoface);
					qunliao.append(qunliaoming);
					$(".faqixia1").append(qunliao);
				};
				//发起聊天里边联系人和群聊的切换
				$(".oo3").click(function  () {
					$(".faqixia").show();
					$(".faqixia1").hide();
				});
				$(".oo4").click(function  () {
					$(".faqixia").hide();
					$(".faqixia1").show();
				});
				//发起聊天的设置调用json里边的动态创建div
				var fqlt = faqiliaotians.faqiliaotian;
				for(var f in fqlt) {
					fqlt[f].pinyin = pinyinUtil.getFirstLetter(fqlt[f].nicheng);
				};
				//通过两个for循环一次比较来进行排序
				for(var i = 0; i < fqlt.length - 1; i++) {
					for(var g = 0; g < fqlt.length - 1 - i; g++) {
						n = fqlt[g];
						if(fqlt[g].pinyin > fqlt[g + 1].pinyin) {
							fqlt[g] = fqlt[g + 1];
							fqlt[g + 1] = n;
						}
					}
				};
				//汉字转拼音
				var shouzimu11 = new Array();
				for(var d in fqlt) {
					shouzimu11 += fqlt[d].pinyin[0];
				};
				//排完序后添加到对应的div里边去
				var szm = new Array();
				for(var h = 0; h < shouzimu11.length; h++) {
					if(szm.indexOf(shouzimu11[h]) >= 0) {
						var name = $("<div class='lianxiren'></div>");
						var yuanquan = $("<div class='yuanquan'></div>");
						var img1 = $("<img/>");
						img1[0].src = fqlt[h].yuanquan;
						var face = $("<div class='face'></div>");
						var img2 = $("<img/>");
						img2[0].src = fqlt[h].touxiang;
						var nicheng = $("<span id='nicheng'></span>");
						nicheng.html(fqlt[h].nicheng);
						yuanquan.append(img1);
						face.append(img2);
						name.append(yuanquan);
						name.append(face);
						name.append(nicheng);
						$(".zhongbu").append(name);
					} else {
						szm += shouzimu11[h];
						$(".zhongbu").append("<div class='zimu'>" + shouzimu11[h] + "</div>");
						var name = $("<div class='lianxiren'></div>");
						var yuanquan = $("<div class='yuanquan'></div>");
						var img1 = $("<img/>");
						img1[0].src = fqlt[h].yuanquan;
						var face = $("<div class='face'></div>");
						var img2 = $("<img/>");
						img2[0].src = fqlt[h].touxiang;
						var nicheng = $("<span id='nicheng'></span>");
						nicheng.html(fqlt[h].nicheng);
						yuanquan.append(img1);
						face.append(img2);
						name.append(yuanquan);
						name.append(face);
						name.append(nicheng);
						$(".zhongbu").append(name);
					}
				}
             //发起聊天里边联系人的点击事件
             var a = 0;
             var c = "";
             $(".lianxiren").click(function  () {
             	$(".lianxiren").css("background-color","white");
             	$(this).css("background-color","#EFEFEF");
                if ($(this).get(0).children[0].innerHTML.indexOf('yuanquan')>0) {
           		$(this).get(0).children[0].innerHTML = "<img src='img/lvseduihao.png'/>";
           		$(".queding").css("background-color","#3CAF36");
           		a++;
           		$("#kuohao").html("("+a+")"); 
           		var b = "<div class=ak47>"+$(this).get(0).children[1].innerHTML+"</div>"
         		c= c+b;
           		$(".fangtouxiang").html(c);
             	} else{
           		$(this).get(0).children[0].innerHTML = "<img src='img/yuanquan.png' />";
           		a--;
           		$("#kuohao").html("("+a+")");
           		//清除div没有成功
        		var b = "<div class=ak47>"+$(this).get(0).children[1].innerHTML+"</div>";  
        		c = c.replace(b,"");
           		$(".fangtouxiang").html(c);
             	};
             })
			});